Optimal. Leaf size=180 \[ \frac {1}{8} a \left (4 a^2+9 b^2\right ) x-\frac {\left (3 a^4-52 a^2 b^2-16 b^4\right ) \sin (c+d x)}{30 b d}-\frac {a \left (6 a^2-71 b^2\right ) \cos (c+d x) \sin (c+d x)}{120 d}-\frac {\left (3 a^2-16 b^2\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}-\frac {a (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {(a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 180, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2870, 2832,
2813} \begin {gather*} -\frac {\left (3 a^2-16 b^2\right ) \sin (c+d x) (a+b \cos (c+d x))^2}{60 b d}-\frac {a \left (6 a^2-71 b^2\right ) \sin (c+d x) \cos (c+d x)}{120 d}+\frac {1}{8} a x \left (4 a^2+9 b^2\right )-\frac {\left (3 a^4-52 a^2 b^2-16 b^4\right ) \sin (c+d x)}{30 b d}+\frac {\sin (c+d x) (a+b \cos (c+d x))^4}{5 b d}-\frac {a \sin (c+d x) (a+b \cos (c+d x))^3}{20 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2832
Rule 2870
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+b \cos (c+d x))^3 \, dx &=\frac {(a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (4 b-a \cos (c+d x)) (a+b \cos (c+d x))^3 \, dx}{5 b}\\ &=-\frac {a (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {(a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (a+b \cos (c+d x))^2 \left (13 a b-\left (3 a^2-16 b^2\right ) \cos (c+d x)\right ) \, dx}{20 b}\\ &=-\frac {\left (3 a^2-16 b^2\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}-\frac {a (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {(a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}+\frac {\int (a+b \cos (c+d x)) \left (b \left (33 a^2+32 b^2\right )-a \left (6 a^2-71 b^2\right ) \cos (c+d x)\right ) \, dx}{60 b}\\ &=\frac {1}{8} a \left (4 a^2+9 b^2\right ) x-\frac {\left (3 a^4-52 a^2 b^2-16 b^4\right ) \sin (c+d x)}{30 b d}-\frac {a \left (6 a^2-71 b^2\right ) \cos (c+d x) \sin (c+d x)}{120 d}-\frac {\left (3 a^2-16 b^2\right ) (a+b \cos (c+d x))^2 \sin (c+d x)}{60 b d}-\frac {a (a+b \cos (c+d x))^3 \sin (c+d x)}{20 b d}+\frac {(a+b \cos (c+d x))^4 \sin (c+d x)}{5 b d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 130, normalized size = 0.72 \begin {gather*} \frac {240 a^3 c+540 a b^2 c+240 a^3 d x+540 a b^2 d x+60 b \left (18 a^2+5 b^2\right ) \sin (c+d x)+120 \left (a^3+3 a b^2\right ) \sin (2 (c+d x))+120 a^2 b \sin (3 (c+d x))+50 b^3 \sin (3 (c+d x))+45 a b^2 \sin (4 (c+d x))+6 b^3 \sin (5 (c+d x))}{480 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 123, normalized size = 0.68
method | result | size |
derivativedivides | \(\frac {\frac {b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+3 b^{2} a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+a^{2} b \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )+a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(123\) |
default | \(\frac {\frac {b^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}+3 b^{2} a \left (\frac {\left (\cos ^{3}\left (d x +c \right )+\frac {3 \cos \left (d x +c \right )}{2}\right ) \sin \left (d x +c \right )}{4}+\frac {3 d x}{8}+\frac {3 c}{8}\right )+a^{2} b \left (\cos ^{2}\left (d x +c \right )+2\right ) \sin \left (d x +c \right )+a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(123\) |
risch | \(\frac {a^{3} x}{2}+\frac {9 a \,b^{2} x}{8}+\frac {9 \sin \left (d x +c \right ) a^{2} b}{4 d}+\frac {5 \sin \left (d x +c \right ) b^{3}}{8 d}+\frac {b^{3} \sin \left (5 d x +5 c \right )}{80 d}+\frac {3 b^{2} a \sin \left (4 d x +4 c \right )}{32 d}+\frac {\sin \left (3 d x +3 c \right ) a^{2} b}{4 d}+\frac {5 \sin \left (3 d x +3 c \right ) b^{3}}{48 d}+\frac {a^{3} \sin \left (2 d x +2 c \right )}{4 d}+\frac {3 \sin \left (2 d x +2 c \right ) b^{2} a}{4 d}\) | \(149\) |
norman | \(\frac {\left (\frac {1}{2} a^{3}+\frac {9}{8} b^{2} a \right ) x +\left (5 a^{3}+\frac {45}{4} b^{2} a \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (5 a^{3}+\frac {45}{4} b^{2} a \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {1}{2} a^{3}+\frac {9}{8} b^{2} a \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {5}{2} a^{3}+\frac {45}{8} b^{2} a \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {5}{2} a^{3}+\frac {45}{8} b^{2} a \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {\left (4 a^{3}-24 a^{2} b +15 b^{2} a -8 b^{3}\right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}+\frac {\left (4 a^{3}+24 a^{2} b +15 b^{2} a +8 b^{3}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}-\frac {\left (12 a^{3}-96 a^{2} b +9 b^{2} a -16 b^{3}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {\left (12 a^{3}+96 a^{2} b +9 b^{2} a +16 b^{3}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {4 b \left (75 a^{2}+29 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(339\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 119, normalized size = 0.66 \begin {gather*} \frac {120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} a^{3} - 480 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{2} b + 45 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} a b^{2} + 32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} b^{3}}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.42, size = 110, normalized size = 0.61 \begin {gather*} \frac {15 \, {\left (4 \, a^{3} + 9 \, a b^{2}\right )} d x + {\left (24 \, b^{3} \cos \left (d x + c\right )^{4} + 90 \, a b^{2} \cos \left (d x + c\right )^{3} + 240 \, a^{2} b + 64 \, b^{3} + 8 \, {\left (15 \, a^{2} b + 4 \, b^{3}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (4 \, a^{3} + 9 \, a b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.31, size = 284, normalized size = 1.58 \begin {gather*} \begin {cases} \frac {a^{3} x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {a^{3} x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {a^{3} \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 a^{2} b \sin ^{3}{\left (c + d x \right )}}{d} + \frac {3 a^{2} b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} + \frac {9 a b^{2} x \sin ^{4}{\left (c + d x \right )}}{8} + \frac {9 a b^{2} x \sin ^{2}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{4} + \frac {9 a b^{2} x \cos ^{4}{\left (c + d x \right )}}{8} + \frac {9 a b^{2} \sin ^{3}{\left (c + d x \right )} \cos {\left (c + d x \right )}}{8 d} + \frac {15 a b^{2} \sin {\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{8 d} + \frac {8 b^{3} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 b^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {b^{3} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\left (c \right )}\right )^{3} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.40, size = 124, normalized size = 0.69 \begin {gather*} \frac {b^{3} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {3 \, a b^{2} \sin \left (4 \, d x + 4 \, c\right )}{32 \, d} + \frac {1}{8} \, {\left (4 \, a^{3} + 9 \, a b^{2}\right )} x + \frac {{\left (12 \, a^{2} b + 5 \, b^{3}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (a^{3} + 3 \, a b^{2}\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (18 \, a^{2} b + 5 \, b^{3}\right )} \sin \left (d x + c\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.05, size = 319, normalized size = 1.77 \begin {gather*} \frac {\left (-a^3+6\,a^2\,b-\frac {15\,a\,b^2}{4}+2\,b^3\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (-2\,a^3+16\,a^2\,b-\frac {3\,a\,b^2}{2}+\frac {8\,b^3}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (20\,a^2\,b+\frac {116\,b^3}{15}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (2\,a^3+16\,a^2\,b+\frac {3\,a\,b^2}{2}+\frac {8\,b^3}{3}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (a^3+6\,a^2\,b+\frac {15\,a\,b^2}{4}+2\,b^3\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+10\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+5\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {a\,\mathrm {atan}\left (\frac {a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (4\,a^2+9\,b^2\right )}{4\,\left (a^3+\frac {9\,a\,b^2}{4}\right )}\right )\,\left (4\,a^2+9\,b^2\right )}{4\,d}-\frac {a\,\left (4\,a^2+9\,b^2\right )\,\left (\mathrm {atan}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\frac {d\,x}{2}\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________